package cn.xd.itstack.springframework.beans.factory;

import cn.xd.itstack.springframework.beans.BeansException;

/**
 * @Classname BeanFactory
 * @Description TODO
 * @Date 2022/5/10 下午2:38
 * @Created by lvxiaodong
 */
public interface BeanFactory {
    /**
     * 根据BeanName获取Bean对象
     * @param beanName
     * @return
     */
   Object getBean(String beanName);

    /**
     * 根据BeanName和构造参数获取对象
     * @param beanName
     * @param args
     * @return
     */
   Object getBean(String beanName, Object ... args);

    /**
     * 根据类型获取Bean
     * @param beanName
     * @param requestedType
     * @param <T>
     * @return
     */
   <T> T getBean(String beanName,Class<T> requestedType);


    <T> T getBean(Class<T> requiredType) throws BeansException;

}
